import { _decorator, Component, Node, RigidBody, RigidBody2D, v2 } from 'cc';
import { JNGSyncProtoBase } from '../App';
import { JNFrameInfo } from '../../../../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame';
const { ccclass, property } = _decorator;

@ccclass('WorldBall')
export class WorldBall extends JNGSyncProtoBase<{}> {

    onSyncUpdate(dt: number,frame:JNFrameInfo, input?: {}): void {
        if(frame.index && frame.index % 12 == 0){
            console.log(`${frame.index}: ${this.nId} : ${this.node.getPosition().x} ${this.node.getPosition().y} ${this.node.getPosition().z}`);
            this.getComponent(RigidBody2D).applyForceToCenter(v2(0,200),true);
        }
    }
    
}


